<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<%@include file="/jsp/common/inc.jsp"%>
</head>
<script type="text/javascript">
	$(function(){
		$("#seq").numberspinner({
			min : 10,
			max : 100,
			editable : false
		});
		
		// 校验用户名密码
		$("#id").validatebox({
			required : true,
			missingMessage : "请输入角色编号"
		});
		$("#name").validatebox({
			required : true,
			missingMessage : "请输入角色名称"
		});
		$("#description").validatebox({
			required : true,
			missingMessage : "请输入角色描述"
		});
		$("#seq").validatebox({
			required : true,
			missingMessage : "请输入角色序号"
		});
	});
	
	// 提交表单
	var submitForm = function($dialog, $grid, $pjq){
		if($("form").form("validate")){
			var url = "${pageContext.request.contextPath}/roleController/add";
			$.post(url,sy.serializeObject($("form")),function(result){
				if(result.success){
					$grid.datagrid("load");
					$dialog.dialog("destroy");
				}else{
					$pjq.messager.alert("提示:",result.msg,"error");
				}
			},"json");
		}
	}
	
</script>
<body>
	<form action="post" class="form">
		<fieldset>
			<legend>角色基本信息</legend>
			<table class="table" style="width: 100%">
				<tr>
					<td>角色编号</td>
					<td><input id="id" name="id" maxlength="10"/></td>
					<td>角色名称</td>
					<td><input id="name" name="name" maxlength="10"/></td>
				</tr>
				<tr>
					<td>角色描述</td>
					<td><input id="description" name="description" maxlength="20"></td>
					<td>顺序</td>
					<td><input name="seq" id="seq" /></td>
				</tr>
			</table>

		</fieldset>
	</form>
</body>
</html>


